/*************************************************************************
> File Name: 5.c
> Author: hzy
> Created Time: 2023-07-24 17:22:49
> Description: 5、给一个二维数组赋值，并打印出数组及数组元素的地址。
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char const *argv[])
{
    int a[3][4] = {0};
    int *p = &a[0][0];
    int i, j, n = 4;

    for (i = 0; i < 3; i++)
    {
        for (j = 0; j < 4; j++)
        {
            scanf("%d", (p + i * n + j));
        }
    }

    for (i = 0; i < 3; i++)
    {
        printf("\n");
        for (j = 0; j < 4; j++)
        {
            printf("a[%d][%d]=%-4d\t", i, j, *(p + i * n + j));
        }
    }
    printf("\n");

    return 0;
}